home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
aminet
/
dev
/
misc
/
f2c.readme
< prev
next >
Wrap
Text File
|
1993-04-24
|
3KB
|
67 lines
Short: A Fortran->C source code translator
Type: dev/lang
Uploader: egstern@fnpx01.fnal.gov
f2c - a Fortran to C converter
This f2c is ported from the July 1992 version taken from
research.att.com and targeted for SAS/C 6.2. All the original
code is included. My modifications are #ifdefed into the source. The
parser code was generated with GNU bison so I've included the GNU
alloca.c.
Using SAS/C versions before 6.2 will not work because of compiler
bugs. This release of f2c has not been extensively tested. The f2c
program is most likely to be correct. The I/O library I77.lib is
probably full of bugs. Known AmigaDOS problems make it a problem to
write to the NIL: device and probably also to pipes.
The source is organized into three directories:
f2c/src contains the source and executable for the f2c
program. Also has the f2c.h include file.
f2c/F77lib contains the source and library F77.lib.
f2c/I77lib contains the source and library I77.lib.
I've included my smakefile for making f2c, I77.lib and F77.lib. I
have not make a version for 68881. If you want to do this, I suggest
you change include:math.h to include m68881.h at the end, then recompile
everything with the math=68881 option. There is a formatted man page
for f2c in src/f2c.1.
To compile and link a fortran program you run f2c on the .f file to
make a .c file. Recommended options are -A for ansi C. Slink
cannot deal with multiply defined global variables, even with the
'common' option (this problem has been reported to SAS). If you use
common blocks you should also compile your program with -E. This
makes all the declarations of the common blocks listed as 'extern'.
You should then put all your common blocks into a BLOCK DATA somewhere
which you compile without -E. Then the linker will be happy.
Then you compile the .c files with sc. The libraries that I've
supplied have been compiled with data=far and math=ieee, so you should
compile your programs this way. The generated C code makes use of the
file f2c.h which can be found in the f2c/src directory. The C code
calls support routines from the libraries F77.lib and I77.lib so you
should link with them and also with scnb.lib. A suitable SCOPTIONS
file might look:
DATA=FAR
MATH=IEEE
LINK
NOICONS
LIBRARY=lib:f77.lib
LIBRARY=lib:i77.lib
There is an example smakefile for a large project in
f2c/smakefile-example.
Good luck. Feel free to fix any problems you find. I'll try to
coordinate any improvements that people make.
Eric Stern
egstern@fnpx19.fnal.gov